/**
 * Created by Administrator on 2017/3/16.
 */


function AjaxUpgetValue() {
    var upname = $("#upname").val();
    var sex, check,obj;
    if ($("#upsex1:checked").val()) {
        sex = 1;
    } else {
        sex = 0;
    }
    if ($("#upclass1:checked").val()) {
        check = 1;
    } else if ($("#upclass2:checked").val()) {
        check = 2;
    } else {
        check = 3;
    }

    obj = {
        name:upname,
        sex:sex,
        classname:check
    }
    console.log(obj);
    $.ajax({
        type:"post",
        url:"/AjaxUpPostsend",
        data:obj,
        success:function(data){
            console.log(data);
        }
    })

}

function AjaxUpgetValue2() {
    var obj ={
        name:$("#selectinput").val()
    };
    $.ajax({
        type:"post",
        url:"/AjaxUpPostsend2",
        data:obj,
        success:function(data){
        console.log(data);
        if(data.length != 0){
            var sex;
            data[0].s_sex.data[0]==1?sex="男":sex="女";
            var str = data[0].s_name+"是一个"+sex+"性，他（她）的班级是"+data[0].c_s_id+"班";
            $(".selectshow").text(str);
        }else{
            $(".selectshow").text("没有这个结果");
        }

    }
})
}